<template>

  <div class="modal" :style="style">
    <div class="modal-background"></div>
    <div class="modal-content">
      <div id="modal"></div>
    </div>
    <button class="modal-close is-large" @click="modal.hideModal"></button>
  </div>
  <NavBar />
  <section class="section">
    <div class="container">
      <router-view />
    </div>
  </section>
</template>
<script lang="ts">
import {defineComponent,computed,ref} from "vue"
import NavBar from "@/components/NavBar.vue"

import {useModal} from "@/utils/useModal"
export default defineComponent({
  name:"App",
  components: {NavBar},
  setup(){
    const modal=useModal()
    const style=computed(()=>({
      display:modal.visible.value?'block':'none'
    }))
    return {modal,style}
  }
})
</script>
<style scoped>
.modal-content{
  top:10%;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
